package ExtendDemo.demo11;

import java.io.*;
import java.net.Socket;

public class ClientDemo {
    public static void main(String[] args) throws IOException {
        Socket s=new Socket("192.168.0.101",10003);
        /*OutputStream os = s.getOutputStream();
        os.write("Hello".getBytes());*/
        BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(s.getOutputStream()));
        bw.write("Hello");
        bw.newLine();
        bw.flush();
        s.shutdownOutput();
        InputStream is = s.getInputStream();
        BufferedReader br=new BufferedReader(new InputStreamReader(is));
        String line;
        while ((line=br.readLine())!=null){
            System.out.println(line);
        }
        is.close();
        s.close();

    }
}
